package cn.outsourcing.supermarket.controller.backstage;

import cn.outsourcing.supermarket.common.Result;
import cn.outsourcing.supermarket.common.utils.ResultUtils;
import cn.outsourcing.supermarket.dto.backstage.BackstageUserInfoDTO;
import cn.outsourcing.supermarket.service.HiolabsAdminService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 管理员入口控制器
 *
 * @author gzkemays
 * @since 2021/10/25 17:53
 */
@RestController
@RequestMapping("/admin/auth")
public class AuthController {
  @Resource HiolabsAdminService adminService;

  @PostMapping("/login")
  public Result login(@RequestBody BackstageUserInfoDTO loginDto) {
    return ResultUtils.simpleResult(adminService.login(loginDto));
  }
}
